import { getRequest, postRequest, putRequest, deleteRequest } from '/src/lib/axios';
import { localRead } from '/@/utils/local-util';
import LocalStorageKeyConst from '/@/constants/local-storage-key-const.js';
const token = localRead(LocalStorageKeyConst.WVP_TOKEN);
const baseUrl = "/wvpApi/playback"

export const api = {
  // 查询回流地址
  getVideoUrl: (param = {}) => {
    return getRequest({
      url: baseUrl + '/start/' + param.url,
      params: {
        startTime: param.startTime,
        endTime: param.endTime,
      },
      header: {
        "access-token": token
      }
    });
  },

  // 停止播放
  stopPlayBack: (address) => {
    return getRequest({
      url: baseUrl + '/stop/' + address,
      header: {
        "access-token": token
      }
    });
  },

  // 倍速播放
  playbackSpeed: (address) => {
    return getRequest({
      url: baseUrl + '/speed/' + address,
      header: {
        "access-token": token
      }
    });
  },

};
